/*
 * GameManager.h
 *
 *  Created on: Feb 10, 2010
 *      Author: Daniel Crown
 */

#ifndef GAMEMANAGER_H_
#define GAMEMANAGER_H_

#include "..\GameObjects\Plane.h"
#include "..\GameObjects\ScrollingBG.h"
#include "..\GameObjects\Projectile.h"
#include "..\GameObjects\Baddie.h"
#include "Clock.h"
#include <windows.h>

const int START_POS_X = 10;
const int MAX_PROJECTILES = 10;
const int MAX_BADDIES = 10;

class GameManager
{
public:
	GameManager() {}
	virtual ~GameManager() {Clear();}

	void Clear() {}
	void Create();
	void Destroy() {}

	void Loop();

	void MovePlane(Direction d);
	void PlaneFire();

private:

	void Update();
	void Render();
	void StoreStats();

	Plane plane;
	ScrollingBG bg;

	Clock gameClock;
	Clock playClock;

	int nextProj;
	Projectile proj[MAX_PROJECTILES];
	vector<Baddie*> baddies;

	//loop variables
	DWORD oversleepTime_ms, excessURTime_ms;
	int tiredCounter, totalSkippedFrames;
	short urTime_ms, timeToKill_ms;

	float avgFPS, avgUPS;
};
#endif /* GAMEMANAGER_H_ */
